#ifndef COMMODITYINFORMATION_H
#define COMMODITYINFORMATION_H

#include <QWidget>
#include "commodity.h"

class CategorySettings;
class InquireSql;
class AddModifyCommodity;
class AttributeSetting;

namespace Ui {
class CommodityInformation;
}

enum attributeValue{Specification, Brand, Color, Unit, Category};

class CommodityInformation : public QWidget
{
    Q_OBJECT
    
public:
    explicit CommodityInformation(QWidget *parent = 0);
    ~CommodityInformation();
    void displayCommodityInformation(const QString &);

signals:
//     void PushButtonNewResponse(QString);

//     void PushButtonModifyResponse(QString);

     void comboBoxOtherSettingsChange(QString);

private slots:

    void on_pushButtonNew_clicked();

    void on_pushButtonModity_clicked();

    void on_comboBoxOtherSettings_activated(const QString &);

    void slotDisplayCommodityInformation();

    void on_pushButtonDelete_clicked();

    void slotUpdateAddModifyCommodity(int);

    void on_comboBoxOtherSettings_currentIndexChanged(int index);

    void on_pushButtonInquire_clicked();

private:
    Ui::CommodityInformation *ui;

    void setTableWidgetColor();

    QString completionPrice(const QString &);

    CategorySettings *m_categorysettings;

    InquireSql *m_sql;

    commodityList m_list;

    AddModifyCommodity *m_addModifyCommodity;

    AttributeSetting *m_attributeSetting;
};

#endif // COMMODITYINFORMATION_H
